﻿using System.Web;

namespace Eneta.Portal.Forum
{
    public class RssLinksDto
    {
        public string RssUrl { get; set; }
        public string RssTitle { get; set; }
        public string CommentsRssUrl { get; set; }
        public string CommentsRssTitle { get; set; }

        public bool RssVisible
        {
            get
            {
                return !string.IsNullOrEmpty(RssUrl) &&
                       !string.IsNullOrEmpty(RssTitle);
            }
        }

        public bool CommentsRssVisible
        {
            get
            {
                return !string.IsNullOrEmpty(CommentsRssUrl) &&
                       !string.IsNullOrEmpty(CommentsRssTitle);
            }
        }

        public static RssLinksDto Current
        {
            get
            {
                var context = HttpContext.Current;
                return (RssLinksDto)context.Items["RssLinks"];
            }
            set
            {
                var context = HttpContext.Current;
                context.Items["RssLinks"] = value;
            }
        }
    }
}
